package com.hnu.util;

import com.hnu.web.ServiceLocator;

public class ScheduleIndexTask {
	private ServiceLocator servLocator;

	public void scheduleIndex() {
		String indexPath = this.getClass().getResource("/").getPath();
		indexPath = indexPath.substring(1, indexPath.indexOf("WEB-INF"))+"indexPath";
		indexPath = indexPath.replaceFirst("%20", " ");
		boolean isExecute = SyncTool.isExecute();
		if (!isExecute) {
			SyncTool.setExecute(true);
			this.servLocator.getBookmarkServ().indexBookmarkBackup(indexPath);
			SyncTool.setExecute(false);
		}
	}

	public void setServLocator(ServiceLocator servLocator) {
		this.servLocator = servLocator;
	}

	public ServiceLocator getServLocator() {
		return servLocator;
	}

}
